//
//  ActivityNet.m
//  SportSocial
//
//  Created by yull on 15/1/12.
//  Copyright (c) 2015年 yull. All rights reserved.
//

#import "ActivityNet.h"

@implementation ActivityNet

+ (AFHTTPRequestOperation *)activityPageWithGroupId:(UInt64)groupId
                                         pageNumber:(NSInteger)pageNumber
                                           pageSize:(NSInteger)pageSize
                                       successBlock:(httpSuccessBlock)succesBlock
                                          failBlock:(httpFailBlock)failBlock
{
    NSString *url = [[NSString alloc] initWithFormat:@"%@/activity/paginate",[self baseUrl]];
    
    NSDictionary *param = @{@"token":[self token],
                            @"group_id":[NSNumber numberWithLongLong:groupId],
                            @"page_number":@(pageNumber),
                            @"page_size":@(pageSize)};
    AFHTTPRequestOperation *operation = [[self manager] GET:url parameters:param success:^(AFHTTPRequestOperation *operation, id responseObject) {
        succesBlock (operation,responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        failBlock (operation,error);
    }];
    return operation;
}
@end
